package com.spider.spiderflowable.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spider.spiderflowable.business.entity.model.FlowApprovalHistory;
import com.spider.spiderflowable.business.entity.model.FlowApprovalRequest;
import com.spider.spiderflowable.business.entity.param.ApprovalParam;
import com.spider.spiderflowable.business.entity.param.ApprovalQueryParam;
import com.spider.spiderflowable.business.entity.param.ApprovalRequestSubmitParam;
import com.spider.spiderflowable.business.entity.vo.FlowApprovalRequestVo;
import java.util.List;

/**
 * @author xiong.bo
 * @version 1.0
 * @date 2025/4/20 3:10 下午
 */
public interface ApprovalRequestService {


  /**
   * 提交申请
   *
   * @param param
   * @return
   */
  FlowApprovalRequest submitApply(ApprovalRequestSubmitParam param);

  /**
   * 审核通过
   *
   * @param param
   * @return
   */
  FlowApprovalRequest approveRequest(ApprovalParam param);

  /**
   * 审核驳回
   *
   * @param param
   * @return
   */
  FlowApprovalRequest rejectRequest(ApprovalParam param);

  /**
   * 查询审批列表
   *
   * @param param
   * @return
   */
  IPage<FlowApprovalRequestVo> selectPage(ApprovalQueryParam param);

  /**
   * 查询审批详情
   *
   * @param id
   * @return
   */
  FlowApprovalRequestVo findById(Long id);

  /**
   * 查询审批详情的审批历史记录
   *
   * @param id
   * @return
   */
  List<FlowApprovalHistory> selectHistoryById(Long id);

//  List<FlowRoleConfig> getRoleByType(ApprovalRequestParam param);

  /**
   * 根据流程实例ID来更新审批申请的状态为已过期
   *
   * @param processInstanceId
   * @return
   */
  boolean expiredRequest(String processInstanceId);




}
